<?php
echo $callbackFunction . '({';
echo '"totalCount":"' . $count . '",';
echo '"excursions":[';
$counter = 0;
if (count($data) > 0) {
	foreach ($data as $excursion) {
		$counter++;
		echo '{';
		echo '"id":"' . $excursion->id . '",';
		echo '"title":"' . addcslashes(htmlspecialchars($excursion->title, ENT_QUOTES), '\\') . '",';
		if ($typeId != 3) {
			echo '"price":"' . $excursion->price . '",';
		}
		echo '"actions":"<a href=\"javascript: editExcursion(' . $excursion->id  . ');\">изменить</a>&nbsp;<a href=\"javascript: deleteExcursion(' . $excursion->id . ',' . $typeId . ');\">удалить</a>"';
		echo '}';
		if ($counter != count($data)) echo ',';
	}
}
echo ']});'; ?>